<template>
    <div class="page">
        <div class="navbar">
            <div class="navbar-inner sliding">
                <div class="left">
                    <a href="#" class="link back">
                        <i class="icon icon-back"></i>
                        <span class="ios-only">返回</span>
                    </a>
                </div>
                <div class="title">{{js 'return (this.$route.params.start+" "+this.$route.params.end)'}} 详细</div>
            </div>
        </div>
        <div class="page-content">
            <div class="list links-list">
                <ul>
                    <li>
                        <div class="item-content">

                            <div class="item-inner">
                                <div class="item-title">没有数据</div>
                                <!-- <div class="item-after">
                                    <span class="badge"></span>
                                </div> -->
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</template>
<script>
    return {
        on: {
            pageInit: function (e, page) {

                var self = this;
                var $ = self.$$;
                var params = self.$route.params;
                console.info(params);
                //保留小数点后指定位数的
                function formatFloat(src, pos) {
                    return Math.round(src * Math.pow(10, pos)) / Math.pow(10, pos);
                }

                app.preloader.show();
                app.request({
                    async: true,
                    url: URL_HEADER + 'query',
                    dataType: 'json',
                    data: params,
                    timeout: timeout,
                    success: function (data, status, xhr) {
                        console.info(data);
                        app.preloader.hide();
                        if (data) {
                            var linkHTML = '';
                            for (var i = 0; i < data.length; i++) {
                                linkHTML +=
                                    '<li>' +
                                    '<div class="item-content">' +

                                    '    <div class="item-inner">' +
                                    '        <div class="item-title">' + data[i].di_name + '</div>' +
                                    '        <div class="item-after">' +
                                    '            <span class="badge">' + data[i].readdate +'</span>  <span class="badge color-blue">' + data[i].value + '</span>' +
                                    '        </div>' +
                                    '    </div>' +
                                    '</div>' +
                                    '</li>';
                            }
                            $(self.$el).find('.list ul').html(linkHTML);

                            if(data.length===0){
                                app.dialog.alert('没有数据');
                            }
                        }
                    },
                    error: function (xhr, status) {
                        //出错
                        //done();
                        app.preloader.hide();
                    }
                });
            }
        }
    }
</script>